
const db = require('db');
const log = require('tools/log');

module.exports = async ctx => {
    const { connection, run } = db.init();

    try {
        ctx.body = ctx.request.files.file.path || ctx.request.files.file.filepath;
        ctx.status = 200;
    } catch (error) {
        ctx.status = 500;
        ctx.body = error;
        log('[/api/fileManage/upload]')
        log(error);
    }

    connection.end();
}